/**
 * 
 */
package com.et114.components.crossscript;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
//import org.springframework.util.AntPathMatcher;
//import org.springframework.util.PathMatcher;
//
//import com.et114.core.utility.ArgumentTokenizer;

/*
 * ant path
 * @author guanhw
 */
public class CrossScriptingFilter4Xss implements Filter {
	private static final long	serialVersionUID	= - 3569848220127720817L;
	protected Log logger = LogFactory.getLog( this.getClass() );	
	private String excludes ;
	public void init ( FilterConfig filterConfig ) throws ServletException {
		excludes = filterConfig.getInitParameter ( "excludes" ) ;
	}
	
	public void destroy ( ) {
	}
	
	public void doFilter ( ServletRequest request , ServletResponse response ,
			FilterChain chain ) throws IOException , ServletException {
			chain.doFilter (
					new CSRequestWrapper ( ( HttpServletRequest ) request ) ,
					response );
		
	}

	public String getExcludes ( ) {
		return excludes;
	}

	public void setExcludes ( String excludes ) {
		this.excludes = excludes;
	}
}
